import httpUtil from "../utils/httpUtil"

const canReceiveVipList = () => {
	return [{
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-iqy.png',
				type: '爱奇艺',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Findex%2Fconfirm-icon%2Fconfirm-iqy-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Faqy-icon.png',
				goodsId: '30157',
			}, {
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-mg.png',
				type: '芒果TV',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Findex%2Fconfirm-icon%2Fconfirm-mg-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fmg-icon.png',
				goodsId: '79',
			}]
		}, {
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-tx.png',
				type: '腾讯视频',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Findex%2Fconfirm-icon%2Fconfirm-tx-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Ftx-icon.png',
				goodsId: '54',
			}, {
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-yk.png',
				type: '优酷会员',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Findex%2Fconfirm-icon%2Fconfirm-yk-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fyk-icon.png',
				goodsId: '84',
			}]
		}, {
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-bilibili.png',
				type: '哔哩哔哩大会员',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-bilibili-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fbilibili-icon.png',
				goodsId: '437',
			}, {
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-shsp.png',
				type: '搜狐视频',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-shsp-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fshsp-icon.png',
				goodsId: '328',
			}]
		}, {
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fvip-xmly.png',
				type: '喜马拉雅',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-xmly-vip.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Ftx-xmly-icon.png',
				goodsId: '381',
			}, {
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Freceive-kgyy-icon.png',
				type: '酷狗音乐豪华VIP',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-kgyy-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fkgyy-icon.png',
				goodsId: '464',
			}]
		}, {
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Freceive-wpstkhy-icon.png',
				type: 'WPS稻壳会员',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-wpstkhy-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fwpstkhy-icon.png',
				goodsId: '237',
			}, {
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Freceive-wpspt-icon.png',
				type: 'WPS普通会员',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-wpspt-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fwpspt-icon.png',
				goodsId: '346',
			}]
		}, {
			list: [{
				icon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Freceive-qqyy-icon.png',
				type: 'QQ音乐绿钻豪华版',
				tipIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fconfirm-qqyy-icon.png',
				receiveIcon: 'https://qiming-1308147483.cos.ap-chengdu.myqcloud.com/doc%2Fpinzhi_shenghuo_huiyuan_quanyi%2Fproduct%2Fqqyy-icon.png',
				goodsId: '177',
			}]
		}


	]
}

const initReceiveVipList = (callBack) => {

	let params = {
		mobile: uni.getStorageSync('tel')
	}
	httpUtil.post('/api/ng/getGoods', params, res => {

		let dataList = res.data.reduce((acc, curr, index) => {
			if (index % 2 === 0) {
				acc.push({
					list: [curr]
				});
			} else {
				acc[acc.length - 1].list.push(curr);
			}
			return acc;
		}, [])

		callBack(dataList)
	})

}

export default {
	canReceiveVipList,
	initReceiveVipList,
}